﻿<UserControl x:Class="LaunchPad.Core.Controls.Tracks.CueControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Height="20" Width="9" Focusable="True">
    <UserControl.Resources>
        <Style TargetType="{x:Type Polygon}">
            <Style.Triggers>
                <DataTrigger Binding="{Binding Path=IsHovered}" Value="True">
                    <Setter Property="Fill" >
                        <Setter.Value>
                            <LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5">
                                <GradientStop Color="WhiteSmoke" Offset="1" />
                                <GradientStop Color="White" Offset="0" />
                            </LinearGradientBrush>
                        </Setter.Value>
                    </Setter>
                </DataTrigger>
                <DataTrigger Binding="{Binding Path=State}" Value="Active">
                    <Setter Property="Fill">
                        <Setter.Value>
                            <LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5">
                                <GradientStop Color="#FF901818" Offset="1" />
                                <GradientStop Color="#FFC4808E" Offset="0" />
                            </LinearGradientBrush>
                        </Setter.Value>
                    </Setter>
                </DataTrigger>
                <DataTrigger Binding="{Binding Path=State}" Value="Waiting">
                    <Setter Property="Fill">
                        <Setter.Value>
                            <LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5">
                                <GradientStop Color="#FFBEC5BA" Offset="1" />
                                <GradientStop Color="White" Offset="0" />
                            </LinearGradientBrush>
                        </Setter.Value>
                    </Setter>
                </DataTrigger>
            </Style.Triggers>
        </Style>
    </UserControl.Resources>
    <Border Name="LeadBorder" BorderBrush="#FFBA3C3C" BorderThickness="1,0,1,0" Background="#47DE7E53">
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Name="leadInCol"/>
                <ColumnDefinition Name="leadOutCol" Width="9"/>
            </Grid.ColumnDefinitions>
            <Polygon Grid.Column="1" Name="cue" Points="0,0 0,15 8,5 8,0" StrokeThickness="1.2" Stroke="Black" Stretch="None" Focusable="True">
              
            </Polygon>

            <Popup Name="timePopup" Width="Auto" Height="Auto" PlacementTarget="{Binding ElementName=cue}" Placement="Top" AllowsTransparency="True">
                <Border Background="White" BorderBrush="LightGray" BorderThickness="1" Padding="2" CornerRadius="2" >
                    <TextBlock Text="{Binding Time}" Foreground="Black"/>
                </Border>
            </Popup>
        </Grid>
    </Border>
</UserControl>
